import {getSignDet, getSignList, signExoprt,} from '@/api/register'

const state = {
  signList: {},
}

const mutations = {
  SET_ATTENDANCELIST: (state, data) => {
    state.signList = data
  }
}

const actions = {
  // 获取签到列表
  getSignListAct({ commit }, params) {
    return new Promise((resolve, reject) => {
      getSignList(params).then(response => {
        const { data } = response
        resolve(data)
      }).catch(error => {

        reject(error)
      })
    })
  },
  // 获取签到详情
  getSignDetAct({ commit }, params) {
    return new Promise((resolve, reject) => {
      getSignDet(params).then(response => {
        const { data } = response
        resolve(data)
      }).catch(error => {
        reject(error)
      })
    })
  },
  // 签到原始信息导出
  signExoprtAct({ commit }, params) {
    return new Promise((resolve, reject) => {
      signExoprt(params).then(response => {
        resolve(response)
      }).catch(error => {
        reject(error)
      })
    })
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

